/*
 * @Author: your name
 * @Date: 2021-12-15 19:50:12
 * @LastEditTime: 2021-12-16 14:28:23
 * @LastEditors: Please set LastEditors
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: \day7\my-app\vue.config.js
 */

let Mock=require('mockjs')

let data=Mock.mock({
    "list|10":[{
       "name":"@ctitle(2,4)",
        "child|10":[{
            "img":"@image(100x100,@color)",
            "name":"@ctitle(4,6)",
            "title":"@ctitle(10,15)",
            "price|10-80":0,
            "count":0,
            "id":"@id",
            "flag":false
        }]
    }]
})

module.exports = {
    devServer:{
        before(app){
            app.get('/api/list', function(req, res) {
              res.send(data.list)
            });
        }
    }
}